#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <string>
#include <numeric>

using namespace std;

int N, target;
int vis[11] = {0};

bool is_good(const vector<int> &v, int target)
{
    vector<int> tmp = v;
    for (int j = N - 1; j > 0; j--)
    {
        for (int i = 0; i < j; i++)
            tmp[i] = tmp[i] + tmp[i + 1];
    }
    return tmp[0] == target;
}

bool dfs(vector<int> &temp)
{
    if (temp.size() == N)
        return is_good(temp, target);
    for (int i = 1; i <= N; i++)
    {
        if (!vis[i])
        {
            vis[i] = 1;
            temp.push_back(i);
            if (dfs(temp))
                return true;
            temp.pop_back();
            vis[i] = 0;
        }
    }
    return false;
}

int main()
{
    cin >> N >> target;
    vector<int> temp;
    dfs(temp);
    for (int i = 0; i < N; i++)
        cout << temp[i] << " ";
    cout << endl;
    return 0;
}